Storage keys are used to control access to storage. In one example, such as in the z/Architecture offered by International Business Machines Corporation, a storage key is associated with each 4K byte block of storage that is available in the configuration. The storage keys afford protection against improper storing or improper storing and fetching from storage. As examples, a store or store and fetch is permitted only when the storage key matches the storage access key associated with the request for storage access.
Currently, in the z/Architecture, there are several instructions used to designate the storage access keys to be used to control access to storage, such as access to source or target operands designated in instructions. These instructions include, Move with Key (MVCK), Move with Destination Key (MVCDK) and Move with Source Key (MVCSK). With each of these instructions, one access key is specified by the instruction and the other access key is indicated in a program status word (PSW), which is a system register used to control instruction execution within the processing environment.
As an example, with the Move with Destination Key instruction, accesses to the destination operand location are performed by using the key specified in general register 1 and accesses to the source operand location are performed by using the PSW key. Similarly, with the Move with Source Key instruction, accesses to the source operand location are performed by using the key specified in general register 1 and accesses to the destination operand location are performed by using the PSW key. Thus, with each of these instructions, an access key is statically predefined by the instruction itself. Further, with each instruction, one of the access keys must be specified in the PSW.